package com.glorious.entities;


import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@TableName("sys_user")
@Table(name = "sys_user", uniqueConstraints = {
        @UniqueConstraint(name = "sys_user_username", columnNames = "username")
})
@org.hibernate.annotations.Table(appliesTo = "sys_user", comment = "后台用户信息表")
@ApiModel("后台用户信息表")
public class SysUser extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -1853675525261716773L;

    @ApiModelProperty(value = "姓名")
    @Column(name = "username", columnDefinition = "varchar(255) COMMENT '姓名'", nullable = false)
    private String username;

    @ApiModelProperty(value = "密码")
    @Column(columnDefinition = "varchar(255) COMMENT '密码'")
    private String password;

    @ApiModelProperty(value = "头像")
    @Column(columnDefinition = "varchar(255) COMMENT '头像'")
    private String avatar;

    @ApiModelProperty(value = "手机号")
    @Column(columnDefinition = "varchar(255) COMMENT '手机号'")
    private String phone;

    @ApiModelProperty(value = "性别 0未知 1女 2男")
    @Column(columnDefinition = "int(1) COMMENT '性别 0未知 1女 2男'")
    private Integer sex;

    @ApiModelProperty(value = "邮箱")
    @Column(columnDefinition = "varchar(255) COMMENT '邮箱'")
    private String email;

    @ApiModelProperty(value = "盐")
    @Column(columnDefinition = "varchar(255) COMMENT '盐'")
    private String salt;

    @ApiModelProperty(value = "用户状态：1-有效；0-禁用")
    @Column(columnDefinition = "int(1) default '1' COMMENT '用户状态：1-有效；0-禁用'")
    private Integer status;
}
